crazy stored procedure shit