refactored code
can now post