Completed core functionality

Completed the core functionality for the script