 		}
 		
 		protected function statefulUpdate():Boolean {
-			if ((U.state.time.moment % U.state.time.clockPeriod) != U.state.time.clockPeriod - 1)
+			if (!writeOK())
 				return false;
 			
 			var changed:Boolean = false;

		}
		
		override protected function generateLayout():ModuleLayout {
			var layout:ModuleLayout = new DefaultLayout(this, 2, 3);
			for (var i:int = 0; i < layout.ports.length; i++)
				layout.ports[i].offset.y -= 1;
			return layout;
		}
		
		override protected function generateInternalLayout():InternalLayout {
			var nodes:Array = [];
			for (var i:int = 0; i < width; i++) {
				var outPort:PortLayout = layout.ports[i + width];
				var dataNode:InternalNode = new StandardNode(this, new Point(outPort.offset.x - 2, outPort.offset.y), [layout.ports[i], outPort], [],
													 outputs[i].getValue /*?*/, width > 1 ? "Stored value " + i : "Stored value", true);
				//dataNode.type = NodeType.STORAGE;
				nodes.push(dataNode);
			}
			return new InternalLayout(nodes);
		}
		
		override public function renderDetails():String {

	import flash.geom.Point;
	import UI.HighlightFormat;
	import UI.ColorText;
	import Displays.DClockModule;
	import Displays.DModule;
	
	/**
	 * ...
	 * @author Nicholas "PleasingFungus" Feinberg
	 */
	public class Latch extends Module implements Clockable {
		
		public var values:Vector.<Value>;
		public var width:int;
