Main php stuff done