refactored, added stuff in