Cleaned up code

with Charlie