Improved signup function