added some documentation + cleanup