added base code
cleanup & organisation