bug fixing, formatting