Working but with a few bits wrong