Made a few changes to the library to make it run faster and be more secure