some bug fixes + modifications in code..