implemented faster algorithm using rages
deleted obsolete files