Fixed a couple of OOPS bugs & streamlined code