added new conditions
added unit test