bug fixing, only a couple left i think