refactored stuff, fixed stuff