changed to lower case and fixed some bugs