Updated everything. Most of the code has been completely rewritten.