Final Merged Code with all Enhancement

Some minor bugs still exist. Will keep trying to iron it out.