cleaned up editmode boolean code