tested and works, achieves bonus functionality