1.3 cleaned up code