some update to the code
needed more changes and did a little house cleaning