cleaned up inline javascript