removed the test code. still needs commenting