fixed use of status
more use of return status
added return value based on make output
simplify logic, remove use of tail
simplify logic