Added most code, still not working.