added top, left, right, bottom functions and cleared compute clauses defindness bug