Needed to set the order of operations properly
found a couple bugs
Merge pull request #64 from retr0h/working

Needed to set the order of operations properly