fixed random errors and added some tests