Fixed visibility statement and added new function