working out some more bugs, almost there!