Bug Solved + Unit tests added