made my code much simpler and cleaner