Cleaned up code a bit and added comments on potential issues with current setup