break function added, bug fixes