improved line snaping, set in place code for undo button faded. Other various code cleanup