refactored a bit
solved 2e