cleaned up code
merged