fix tests for line nest and space functions
fix nest function
update funtions for working with list
use hlint advice