Edited code to match with WordPress coding standards