first iteration of requirements
code cleanup, needs testing!