some tests added
minor code fix
minor bug fix
some tests added