Implementation seems to be working - needs cleanup