tag span to p and cleaned up code