alg3

the file now runs without any syntax etc. errors but as of yet there's
no guarantee that the functions will run correctly or give the correct
output