fixed some warnings and added more documentation