added script to test
 added makefile for easy
added error checking