added support for ranks
added support for resources
fixed typos