Write some code

It kinda works, but it looks horrible and most of the features are
still missing. It can already count the stats though.