Taken elements from DALSE I wanted to keep. Formatted and added
javadocs. I'm tired..