Updated with GPL license and minor edits