Complete Re-write

Code actually works now!!