Small fix after #34, and added some comments to explain a few things better. Thanks Illuminarti
Bug fix after #34