Rewrote class for better readibility and nicer output.