refactored code
misc
updated version