fixed a bug, implemented a spec