cleaned up code (#16)