updated js drawing - reverse direction