Fixes #1. Got rid of reinvented wheels.