Error Handling Included

I included error handling and spruced up some of the functions.
Performance Modifications

Overall performance modifications to help CPU Loads.