New object oriented code implemented. Needs testing by dantsys.