First functional version
Error messages and “authorization” added