cleaned up code slightly