added more constructors and priority logic